--私聊功能菜单
return function (qq,msg,bl)
    --所有需要运行的app
    local app =  {
        {--今日运势
            check = function()
                return msg == "今日运势" or msg == "明日运势" or msg == "昨日运势"
            end,
            run = function()
                local getAlmanac = require("app.common.almanac")
                sendMessage(getAlmanac(qq))
                return true
            end,
            explain = function()
                return "运势"
            end
        },
        {--查快递
            check = function()
                return msg:find("查快递") == 1
            end,
            run = function()
                local express = require("app.common.express.express")
                local m = express(msg, qq)
                sendMessage(m)
                return true
            end,
            explain = function()
                return "查快递"
            end
        },
        {--快递选择
            check = function()
                return msg:find("快递选择") == 1
            end,
            run = function()
                local expresschoose = require("app.express.expresschoose")
                local m = expresschoose(msg, qq)
                sendMessage(m)
                return true
            end,
        },
        {--点歌
            check = function()
                return msg:find("点歌") == 1
            end,
            run = function()
                local qqmusic = require("app.common.qqmusic")
                sendMessage(qqmusic(msg))
                return true
            end,
            explain = function()
                return "点歌"
            end
        },
        {--b站av号解析
            check = function()
                return msg:find("av%d+")
            end,
            run = function()
                local av = require("app.common.av")
                sendMessage(av(msg))
                return true
            end,
            explain = function()
                return "b站av号解析"
            end
        },
        {--一言
            check = function()
                return msg == "一言"
            end,
            run = function()
                local hitokoto = require("app.common.hitokoto")
                sendMessage(hitokoto())
                return true
            end,
            explain = function()
                return "一言"
            end
        },
        {--二维码生成
            check = function()
                return msg:find("二维码生成")==1
            end,
            run = function()
                local key = msg:gsub("二维码生成","")
                if apiQREncode(key) < 0 then
                    sendMessage("数据过长")
                    return true
                end
                sendMessage(cqCqCode_Image("qr.jpg"))
                return true
            end,
            explain = function()
                return "二维码生成"
            end
        },
        {--短故事
            check = function()
                return msg:find("故事")==1
            end,
            run = function()
                local story = require("app.common.tianxinapi.story")
                sendMessage(story())
                return true
            end,
            explain = function()
                return "故事"
            end
        },
        {--二维码logo生成
            check = function()
                return msg:find("二维码logo生成")==1
            end,
            run = function()
                local key = msg:gsub("二维码logo生成","")
                apiCombinImage("qr.jpg","logo.png")
                sendMessage(cqCqCode_Image("add.jpg"))
                return true
            end,
            explain = function()
                return "二维码logo生成"
            end
        },
        {--翻译
            check = function()
                return msg:find("翻译")==1
            end,
            run = function()
                local translate = require("app.common.baidu.translate")
                sendMessage(translate(msg))
                return true
            end,
            explain = function()
                return "翻译"
            end
        },
        {--二维码解码
            check = function()
                return msg:find("二维码解码")==1
            end,
            run = function()
                local QRocr = require("app.common.QRocr")
                sendMessage(QRocr(qq,msg))
                return true
            end,
            explain = function()
                return "二维码解码"
            end
        },
        {--手机端图片延迟输入
            check = function()
                return msg:find("%[CQ:image,file=")==1
            end,
            run = function()
                if tonumber(apiXmlGet("","qrocr",tostring(qq))) == 0 then 
                    local QRocr = require("app.common.QRocr")
                    sendMessage(QRocr(qq,msg))
                end
                return true
            end,
        },
        {--点赞
            check = function()
                return msg:find("赞我")
            end,
            run = function()
                local day = os.date("%Y年%m月%d日")--今天
                local last = apiXmlGet("", "Praise",tostring(qq))
                if last == day then
                    sendMessage(cqCode_At(qq).."今天已经给你点过赞啦")
                    return true
                end
                cqSendPraise(qq,10)
                apiXmlSet("", "Praise",tostring(qq),day)
                sendMessage(cqCode_At(qq).."给你点10个赞！")
                return true
            end,
            explain = function()
                return "赞我"
            end
        },
        {
            --腾讯短链接
            check = function()
                return msg:find('短链接') == 1
            end,
            run = function()
                local keys = msg:gsub('短链接', '')
                keys = kickSpace(keys):encodeURI()
                local surl = apiHttpGet('https://sa.sogou.com/gettiny?url=' .. keys)
                if surl == nil then
                    sendMessage('请输入正确的网址')
                    return true
                end
                sendMessage(surl)
            end,
            explain = function()
                return '短链接'
            end
        },
        {--今日新番
            check = function()
                return msg:find("今日新番") 
            end,
            run = function()
                local global = apiHttpGet("https://bangumi.bilibili.com/web_api/timeline_global"):match("\"is_today\":1,\"seasons\":(.-)]").."]"
                local list = jsonDecode(global)
                local message = ""
                for i=1,#list do
                    title = list[i]['title']
                    if title:find("僅限") == nil then
                        url = list[i]['url']
                        pub_index =list[i]['pub_index']
                        message = message..title.."  "..pub_index.."\n"..url.."\n"
                    end
                end
                sendMessage(message)
                return true
            end,
            explain = function()
                return "今日新番"
            end
        },
    }
    
    -- 执行功能 获取菜单
    if bl then
        for i = 1, #app do
            if app[i].check and app[i].check() then
                return app[i].run()
            end
        end
    else
        local m = ""
        local flag = true
        for i = 1, #app do
            local appExplain = app[i].explain and app[i].explain()
            if appExplain then
                m = m ..appExplain
                if flag then
                    m = m .. "    "
                    flag = nil
                else
                    m = m .. "\n"
                    flag = true
                end
            end
        end
        sendMessage(m)
        return true
    end

end